/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.oneCommerce.entities;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Aymen
 */
@Embeddable
public class ItemFourPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDITEM", nullable = false)
    private BigInteger iditem;
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDFOUR", nullable = false)
    private BigInteger idfour;

    public ItemFourPK() {
    }

    public ItemFourPK(BigInteger iditem, BigInteger idfour) {
        this.iditem = iditem;
        this.idfour = idfour;
    }

    public BigInteger getIditem() {
        return iditem;
    }

    public void setIditem(BigInteger iditem) {
        this.iditem = iditem;
    }

    public BigInteger getIdfour() {
        return idfour;
    }

    public void setIdfour(BigInteger idfour) {
        this.idfour = idfour;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (iditem != null ? iditem.hashCode() : 0);
        hash += (idfour != null ? idfour.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ItemFourPK)) {
            return false;
        }
        ItemFourPK other = (ItemFourPK) object;
        if ((this.iditem == null && other.iditem != null) || (this.iditem != null && !this.iditem.equals(other.iditem))) {
            return false;
        }
        if ((this.idfour == null && other.idfour != null) || (this.idfour != null && !this.idfour.equals(other.idfour))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.oneCommerce.entities.ItemFourPK[ iditem=" + iditem + ", idfour=" + idfour + " ]";
    }
    
}
